//每一个vuex的模块其实都是一个包含state mutations actions getters属性对象,未来把对象交给newVuex.store的配置中作为模块进行配置
const state = {
    count: 0,
};
const mutations = {
    increment(state, payload) {
        state.count += payload.n;
    },
};
const actions = {};
const getters = {};

//为了方便获取vuex模块化的数据和方法,我们会在模块中添加一个namespaced属性值为true(代表开启命名空间)
export default {
    namespaced: true,
    state,
    mutations,
    actions,
    getters,
};